package cn.lizemin.scheduledTask.quartz;

import org.quartz.*;

import java.text.SimpleDateFormat;

/**
 * @author: lizemin
 * @version: 1.0
 */
public class MyTask implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        JobDetail jobDetail = jobExecutionContext.getJobDetail();
        JobDataMap map = jobDetail.getJobDataMap();
        System.out.println(getTime() + "--- hello, i love you ! ---" + map.get("user"));

    }

    public String getTime(){
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        return df.format(System.currentTimeMillis());
    }

}
